package com;

import java.awt.EventQueue;

import javax.swing.UIManager;

import org.arong.axmlswing.GuiXmlLoader;
import org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper;

public class Main {
	public Main() {
		//加载布局文件
		//String xmlfile="/xdemo/components.xml";
		//String xmlfile="/layout/swing-generate.xml";
		String xmlfile="/layout/activemq.xml";
		//String xmlfile="/layout/kafka.xml";
		try {
			long s = System.currentTimeMillis();
			GuiXmlLoader.load(xmlfile);
			System.out.println("渲染时间："+ (System.currentTimeMillis() - s));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public static void initTheme(){
		try {  
			/**
			UIManager.setLookAndFeel(new SubstanceLookAndFeel());  
        	JFrame.setDefaultLookAndFeelDecorated(true);  
        	JDialog.setDefaultLookAndFeelDecorated(true);  
        	SubstanceLookAndFeel.setCurrentTheme(new SubstanceTerracottaTheme());  
        	SubstanceLookAndFeel.setSkin(new BusinessBlueSteelSkin());  
        	SubstanceLookAndFeel.setCurrentButtonShaper(new ClassicButtonShaper());  
        	SubstanceLookAndFeel.setCurrentWatermark(new SubstanceBubblesWatermark());  
        	SubstanceLookAndFeel.setCurrentBorderPainter(new StandardBorderPainter());  
        	SubstanceLookAndFeel.setCurrentGradientPainter(new StandardGradientPainter());  
        	SubstanceLookAndFeel.setCurrentTitlePainter(new FlatTitlePainter());  */
        	
			BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.generalNoTranslucencyShadow;
			BeautyEyeLNFHelper.launchBeautyEyeLNF();
			UIManager.put("RootPane.setupButtonVisible", false);
        } catch (Exception e) {  
            System.err.println("Something went wrong!");  
        } 
	}
	
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                	initTheme();
                	new Main();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
	}

}
